package com.bestcem.xm.award.controller.param.point;

import com.bestcem.xm.award.enums.DeliverSourceEnum;
import com.bestcem.xm.award.enums.PointRecordStatusEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

/**
 * 获取中奖名单中的奖项信息 接收参数
 *
 * @author xa.zhang <xa.zhang@idiaoyan.com>
 * @version v3.0
 * @date 2021/8/19 14:55
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PointAwardWinListParam {
    /**
     * 奖励id
     */
    private String awardId;

    /**
     * 手机号
     */
    private String phone;

    /**
     * 投放方式 {@link DeliverSourceEnum}
     */
    private Integer deliverChannel;

    /**
     * 中奖状态 {@link PointRecordStatusEnum}
     */
    @Min(value = 0, message = "中奖状态错误")
    @Max(value = 100, message = "中奖状态错误")
    private Integer status;

    /**
     * 页号
     */
    @Min(value = 0, message = "页号不能小于0")
    private Integer page;

    /**
     * 分页大小
     */
    @Min(value = 0, message = "每页大小不能小于0")
    private Integer size;

    /**
     * mysql查询开始行数
     */
    private Integer start;

    public Integer getStart() {
        return (page - 1) * size;
    }

    public void setStart(Integer start) {
        this.start = start;
    }

}
    